<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:fn="http://java.sun.com/jsp/jstl/functions"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <h:head>
        <title>Test : Create a trade</title>
    </h:head>
    <h:body>

        <h:form>
            Name : <h:inputText value="#{testCreateTradeController.tradeBean.name}" required="true" />
            <br/>
            Stock : <h:selectOneMenu value="#{testCreateTradeController.tradeBean.stock}" converter="stockListConverter">
                <f:selectItem itemLabel="Choose a stock..." noSelectionOption="true" />
                <f:selectItems value="#{listsBean.stocks}" var="stock" itemValue="#{stock}" itemLabel="#{stock.name} (#{stock.ticker})" />
            </h:selectOneMenu>
            <br />
            Direction : <h:selectOneMenu value="#{testCreateTradeController.tradeBean.direction}" converter="directionListConverter">
                <f:selectItem itemLabel="Choose a direction..." noSelectionOption="true" />
                <f:selectItems value="#{listsBean.directions}" var="direction" itemValue="#{direction}" itemLabel="#{direction.name}" />
            </h:selectOneMenu>
            <br />            
            Timeframe : <h:selectOneMenu value="#{testCreateTradeController.tradeBean.timeframe}" converter="timeframeListConverter">
                <f:selectItem itemLabel="Choose a timeframe..." noSelectionOption="true" />
                <f:selectItems value="#{listsBean.timeframes}" var="timeframe" itemValue="#{timeframe}" itemLabel="#{timeframe.name}" />
            </h:selectOneMenu>
            <br />
            Analysis : <h:selectOneMenu value="#{testCreateTradeController.tradeBean.analysis}" converter="analysisListConverter">
                <f:selectItem itemLabel="Choose an analysis..." noSelectionOption="true" />
                <f:selectItems value="#{listsBean.analyses}" var="analysis" itemValue="#{analysis}" itemLabel="#{analysis.name}" />
            </h:selectOneMenu>
            <br />
            Signal : <h:selectOneMenu value="#{testCreateTradeController.tradeBean.signal}" converter="signalListConverter">
                <f:selectItem itemLabel="Choose a signal..." noSelectionOption="true" />
                <f:selectItems value="#{listsBean.signals}" var="signal" itemValue="#{signal}" itemLabel="#{signal.name}" />
            </h:selectOneMenu>
            <br />
            Tag : <h:selectOneMenu value="#{testCreateTradeController.tradeBean.tag}" converter="tagListConverter">
                <f:selectItem itemLabel="Choose a tag..." noSelectionOption="true" />
                <f:selectItems value="#{listsBean.tags}" var="tag" itemValue="#{tag}" itemLabel="#{tag.tag}" />
            </h:selectOneMenu>
            <br />
            <h:commandButton value="Create trade" action="#{testCreateTradeController.create}" />
        </h:form>
    </h:body>
</html>